added SSCLI 1.0
[windows-sources.git] / shared source / wpf / src / host / shimimpl / bindstatuscallback.hxx
blobe9939c69428922ebe7809ae53366d8abfe5f791c
1 //+-----------------------------------------------------------------------
2 //
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 //
5 // Description:
6 // Defines the BindStatusCallback class of PresentationHost.
7 //
8 // History
9 // 2002/06/22-murrayw
10 // Created
11 // 2007/09/20-[....]
12 // Ported Windows->DevDiv. See SourcesHistory.txt.
14 //------------------------------------------------------------------------
16 #pragma once
18 #define IO_BUFFER_SIZE 4096
20 class CBindStatusCallback : public IBindStatusCallback
22 public:
24 CBindStatusCallback();
25 ~CBindStatusCallback();
27 LPCWSTR GetCacheFilename() const
29 return m_cacheFilename.Length() ? m_cacheFilename.GetValue() : 0;
31 HRESULT GetBindResult() const { return m_hrBindResult; }
34 // IUnknown
37 STDMETHODIMP QueryInterface(REFIID riid, __out LPVOID* ppReturn);
38 STDMETHODIMP_(ULONG) AddRef();
39 STDMETHODIMP_(ULONG) Release();
42 // IBindStatusCallback methods
45 STDMETHODIMP OnStartBinding(DWORD dwReserved, __in IBinding *pib);
46 STDMETHODIMP GetPriority(__out_opt LONG *pnPriority);
47 STDMETHODIMP OnLowResource(DWORD dwReserved);
48 STDMETHODIMP OnProgress(ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode,
49 LPCWSTR szStatusText);
50 STDMETHODIMP OnStopBinding(HRESULT hresult, LPCWSTR /* szError */);
51 STDMETHODIMP GetBindInfo(__out DWORD *grfBINDF,
52 __out BINDINFO *pbindinfo);
53 STDMETHODIMP OnDataAvailable(DWORD grfBSCF,
54 DWORD dwSize,
55 __in FORMATETC *pformatetc,
56 __in STGMEDIUM *pstgmed);
57 STDMETHODIMP OnObjectAvailable(REFIID riid, __in IUnknown *punk);
59 BOOL IsXps() { return (m_Mime == MimeType_Xps); }
60 MimeType GetMimeType() { return m_Mime; }
61 STRING_PROP(MimeTypeString);
64 // Data members
67 IStream* m_pStream;
68 IFillLockBytes* m_pflb;
69 HANDLE m_hMimeArrivedEvent; // Event triggers when mime arrives
70 HANDLE m_hManifestAvailableEvent; // Event triggers when the manifest is ready
71 class DownloadInfo* m_pDownloadInfo;
72 CString m_cacheFilename;
75 // Data members
77 MimeType m_Mime;
78 CString m_strMimeTypeString;
79 ULONG m_nBytesTotal;
80 ULONG m_nBytesRead;
81 BOOL m_fTerminatedFLB;
82 IBinding* m_pib;
83 int m_nObjRefCount;
84 HRESULT m_hrBindResult;
86 private:
87 void BindTerminated();
88 void BindTerminated(HRESULT hr);
89 void ResolveMimeTypeSecondChance(LPCWSTR pszLocalFile);